<template>
  <div v-if="layout">
    {{ lid }}
  </div>
</template>

<script>
import { queryOne } from '@/api/portal/manager/layout';
export default {
  name: 'PortalNewSetting',
  props: {
    lid: {
      type: Number,
      default: null
    }
  },
  data() {
    return {
      layout: null
    };
  },
  methods: {
    initObject(data) {
      this.layout = null;
      if (undefined === data || data === null) {
        this.$message.error('请创建布局！');
      } else {
        this.lid = data;
        queryOne({ id: data })
          .then(res => {
            const { data } = res;
            this.layout = data;
          })
          .catch(() => {
            this.$message.error('请创建布局！');
          });
      }
    }
  }
};
</script>

<style scoped></style>
